import java.util.Scanner;

class Hello {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int b = 0;
		int k = 0;
		int[] a = new int[4];
		for (int i = 0; i < 4; i++) {
			double f1 = Math.random();
			f1 *= 10;
			a[i] = (int) f1;
		}
		while (a[1] == a[0]) {
			a[1] = (int) Math.random();
		}
		while (a[2] == a[0] || a[2] == a[1]) {
			a[2] = (int) Math.random();
		}
		while (a[3] == a[0] || a[3] == a[1] || a[3] == a[2]) {
			a[3] = (int) Math.random();
		}
		do {
			b = 0;
			k = 0;
			int n;
			int d[] = new int[4];
			for (int i = 0; i < 4; i++) {
				do {
					System.out.print("Enter digit # " + (i + 1) + ": ");
					n = sc.nextInt();
					d[i] = n;
				} while (n > 9 || n < 0);
			}
			for (int i = 0; i < 4; i++) {
				if (a[i] == d[i]) {
					b++;
				}
			}
			System.out.println(b + " b");
			for (int i = 0; i < 4; i++) {
				for (int j = 0; j < 4; j++) {
					if (i != j && a[i] == d[j]) {
						k++;
					}
				}
			}
			System.out.println(k + " k");
//			for (int i = 0; i < 4; i++)
//				System.out.print(a[i]);
		} while (b != 4);
		System.out.println("You win!");
	}
}